const mix = require('laravel-mix');
const path = require('path');

mix.webpackConfig({
  output: {
    publicPath: "/",
    chunkFilename: 'js/[name].[chunkhash].js'
  },
  resolve: {
    alias: {
      'common': 'assets/js/common',
      'components': 'assets/js/components',
      'particals': 'assets/js/particals',
      'packages': 'assets/js/packages',
      'config': 'assets/config',
      'plugs': 'assets/js/plugs',
      'router': 'assets/js/router',
      'static': 'assets/js/static',
      'store': 'assets/js/store',
      'database': 'assets/js/database',
      'tool': 'assets/js/tool'
    },
    modules: [
      'node_modules',
      path.resolve(__dirname, "resources")
    ]
  },
})
/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application. By default, we are compiling the Sass
 | file for the application as well as bundling up all the JS files.
 |
 */

mix.js('resources/assets/js/app.js', 'public/js')
   .extract(['vue', 'vuex', 'vue-router', 'axios'])
   .js('resources/assets/js/hash.js', 'public/js')
   .sass('resources/assets/sass/app.scss', 'public/css');